package com.qiaofang.common.model;

import lombok.Data;

@Data
public class PageDTO {

    public static final String DESC = "desc";
    public static final String ASC = "asc";
    private Integer pageSize = 20;
    private Integer pageNum = 1;
    private String sortBy;
    private String desc;

    public Integer getOffset() {
        if (this.pageNum <= 0) {
            this.pageNum = 1;
        }
        Integer skipResults = (this.pageNum - 1) * this.pageSize;
        return skipResults;
    }

}
